<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="button" @click="fn1" value="浪起来">
        <input type="button" @click="fn2" value="停止">

        <h3>{{ msg }}</h3>
    </div>

    <script>
        var vm = new Vue({
            data: {
                msg: '我拿Buff,谢谢~',
                dsq:false
            },
            methods: {
                
                fn1(){
                    if(this.dsq)return
                this.dsq= setInterval(()=>{
                    const a=this.msg.slice(0,1)
                    const b=this.msg.slice(1)
                    this.msg=b+a
                },500)
              },
              fn2(){
                clearInterval(this.dsq)
                this.dsq=false
              }
            }
        }).$mount('#app')
    </script>
</body>

</html>